package com.ruoyi.system.feign;

import com.ruoyi.common.constant.ServiceNameConstants;
import com.ruoyi.system.feign.factory.RemoteLogFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


@FeignClient(name = ServiceNameConstants.JACFILE_SERVICE, fallbackFactory = RemoteLogFallbackFactory.class)
public interface RemoteFileService {

    /**
     * 远程调用文件下载
     */
    @GetMapping("file/download/{fileid}")
    public Object fileDownload(@PathVariable("fileid") Long fileid, Long userId, HttpServletResponse response, HttpServletRequest request);

    /**
     * 远程调用文件上传
     */
    @PostMapping("file/upload")
    public String upload(MultipartFile file);
}
